from enum import Enum

from views.template_page_view import FormItemDto


class FormItemsKey(Enum):

    # 配置键枚举
    STOCK_MONEY = (
        "setting.stock.money.all",
        FormItemDto("总资金量", "setting.stock.money.all", "100000", "int"),
    )

    STOCK_MONEY = (
        "setting.stock.market.risk.up",
        FormItemDto("风险点位", "setting.stock.market.risk.up", "100000", "int"),
    )

    TUSHARE_TOKEN = (
        "setting.app.tushare.token",
        FormItemDto("Tushare Token", "setting.app.tushare.token", "", "text"),
    )

    def __init__(self, key: str, form_item: FormItemDto):
        self.key = key
        self.form_item = form_item

    def __str__(self):
        return self.key
